package com.match.competition_apply.client;

import com.match.commonutils.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 芊薰
 */
@FeignClient(name = "service-base",fallback = CourseClientImpl.class)
@Component  //将接口交给spring管理
public interface CourseClient {
       @ApiOperation("查找课程类别")
       @GetMapping("/competition_sub/course/getCourseType")
       public Result getCourseType();

       @ApiOperation("查询所有竞赛组织员")
       @GetMapping("/competition_sub/teacher/getAllTeacherByRole")
       public Result getAllTeacherByRole();

       @ApiOperation("查询所有的教师部门")
       @GetMapping("/competition_sub/teacher/getAllTeacherDepartment")
       public Result getAllTeacherDepartment();

       @ApiOperation("得到教师信息")
       @GetMapping("/competition_sub/teacher/getTeaByNum/{number}")
       public Result getTeaByNum(@PathVariable(value = "number")String number);

       @ApiOperation("得到所有的教师")
       @GetMapping("/competition_sub/teacher/getAllTeacherUseAdviser")
       public Result getAllTeacherUseAdviser();

       @ApiOperation("得到所有学生")
       @GetMapping("/competition_sub/student/getAllEntryStudent")
       public Result getAllEntryStudent();

       @ApiOperation("为学生分配角色")
       @PostMapping("/competition_sub/student/assignRoleToStudent")
       public Result assignRoleToStudent(@RequestBody Map<String,Object> map);

       @ApiOperation("根据学生学号查询学生信息接口")
       @GetMapping("/competition_sub/student/findStuByNum/{number}")
       public Result findStuByNum(@ApiParam(value = "学号") @PathVariable String number);

       @ApiOperation("更新学生的认证学分")
       @GetMapping("/competition_sub/student/updateStudentCredit/{groutId}/{affirmCredit}")
       public Result updateStudentCredit(@ApiParam(value = "组别Id") @PathVariable(value = "groutId") String groutId,
                                         @ApiParam(value = "认证学分") @PathVariable(value = "affirmCredit") String affirmCredit);
}
